package com.bsoft.exchange.controller.appointmentandregistration;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.bsoft.exchange.domain.Doctor;
import com.bsoft.exchange.pojo.ListDoctorPojo;
import com.bsoft.exchange.response.ResponseEntity;
import com.bsoft.exchange.service.DoctorService;

import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping(value = "appointment")
public class DoctorController {
	@Autowired
	private DoctorService doctorService;

	@ApiOperation(value = "医生信息获取")
	@RequestMapping(value = "/listDoctor",method = RequestMethod.POST,produces = "application/json")
//	public List<Doctor> selectList(@RequestParam(value = "hospitalCode") String hospitalCode,
//			@RequestParam(value = "departmentCode") String departmentCode,
//			@RequestParam(value = "scheduleDate",required = false) String scheduleDate,
//			@RequestParam(value = "doctorCode",required = false) String doctorCode,
//			@RequestParam(value = "doctorType",required = false) String doctorType,
//			@RequestParam(value = "outpatientType") int outpatientType,
//			@RequestParam(value = "lastModifyTime",required = false) Date lastModifyTime) {
//		return doctorService.selectList(hospitalCode,departmentCode,scheduleDate,doctorCode,doctorType,outpatientType,lastModifyTime);
//	}
	public ResponseEntity<List<Doctor>> selectList(@RequestBody ListDoctorPojo listDoctorPojo) {
		List<Doctor> doctor = doctorService.selectList(listDoctorPojo.getOrganizationId(),listDoctorPojo.getDepartmentId(),listDoctorPojo.getScheduleDate(),listDoctorPojo.getDoctorId(),listDoctorPojo.getDoctorType(),listDoctorPojo.getOutpatientType(),listDoctorPojo.getLastModifyTime());
			ResponseEntity<List<Doctor>> entity=new ResponseEntity<>();
			
			entity.setData(doctor);
			
			return entity;
	
	}
}
